/* 基础变量 */
:root {
    --primary-color: #007AFF;
    --background-color: #F2F2F7;
    --panel-background: #FFFFFF;
    --text-color: #000000;
    --text-secondary: #8E8E93;
    --border-color: #E5E5EA;
    --spacing: 16px;
    --border-radius: 12px;
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
}

/* 布局样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing);
}

header {
    text-align: center;
    margin-bottom: calc(var(--spacing) * 2);
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--spacing);
}

.device-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing);
}

main {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing);
    height: calc(100vh - 120px);
    max-height: 800px;
}

.panel {
    background: var(--panel-background);
    border-radius: var(--border-radius);
    padding: var(--spacing);
}

/* 设备列表样式 */
.devices-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.devices-panel h2 {
    font-size: 18px;
    margin-bottom: var(--spacing);
}

.device-list {
    flex: 1;
    overflow-y: auto;
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: var(--spacing);
}

.device-item {
    padding: 12px;
    border-radius: 8px;
    background: var(--panel-background);
    cursor: pointer;
    margin-bottom: 8px;
    word-break: break-all;
}

.device-item:last-child {
    margin-bottom: 0;
}

.device-item.selected {
    background: var(--primary-color);
    color: white;
}

.device-item.no-device {
    color: var(--text-secondary);
    cursor: default;
    font-style: italic;
}

/* 聊天区域样式 */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--spacing);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    position: relative;
    transition: background-color 0.3s ease;
}

/* 拖放样式 */
.chat-messages.drag-over {
    background-color: rgba(0, 122, 255, 0.1);
}

.chat-messages.drag-over::after {
    content: '拖放文件到这里发送';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--primary-color);
    border: 2px dashed var(--primary-color);
    pointer-events: none;
}

/* 消息样式 */
.chat-message {
    margin-bottom: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    max-width: 80%;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-message.self {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
}

.chat-message.other {
    background: white;
    border: 1px solid var(--border-color);
}

/* 输入区域样式 */
.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--background-color);
    border-radius: var(--border-radius);
    min-height: 68px;
    align-items: center;
}

#messageInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    min-height: 52px;
    max-height: 120px;
    line-height: 20px;
    resize: none;
    overflow-y: auto;
    font-family: inherit;
}

#messageInput:focus {
    border-color: var(--primary-color);
}

/* 文件选择按钮 */
.file-select-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--background-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.file-select-button:hover {
    background: var(--border-color);
}

.file-select-button input[type="file"] {
    display: none;
}

.file-select-button .icon {
    width: 100%;
    height: 100%;
    fill: var(--primary-color);
}

/* 文件传输相关样式 */
.file-message {
    padding: 6px 10px;
    background: white;
    border-radius: 8px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.file-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-color);
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 14px;
}

.file-details {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.file-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.file-size {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-bar {
    flex: 1;
    height: 3px;
    background: var(--background-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0;
}

.status {
    font-size: 11px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.controls {
    display: flex;
    gap: 4px;
}

.control-button {
    flex: 1;
    padding: 4px 0;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.control-button.pause-resume {
    background: var(--background-color);
    color: var(--text-color);
}

.control-button.cancel {
    background: #ffebee;
    color: #e53935;
}

.control-button:hover {
    opacity: 0.9;
}

.control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式布局 */
@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        height: auto;
    }

    .devices-panel {
        max-height: 300px;
        margin-bottom: var(--spacing);
    }

    .chat-panel {
        height: calc(100vh - 450px);
    }
} 